const html = `<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body>
    <button id="btn">BroadcastChannel发信息给页面1</button>
    <div class="content"></div>
    
    <script>
      const btn = document.getElementById('btn')
      const content = document.getElementsByClassName('content')

      //BroadcastChannel
      const channel = new BroadcastChannel('test')
      channel.onmessage = (e) => {
        content[0].innerHTML = e.data
      }
      btn.onclick = () => {
        channel.postMessage('BroadcastChannel发信息给页面1')
      }

      window.onunload = () => {
        channel.close()
      }

    </script>
  </body>
</html>
`;

export default html;
